# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-findpython
pkgver=0.4.1
pkgrel=0
pkgdesc="Utility to find python versions on your system"
url="https://github.com/frostming/findpython"
arch="noarch"
license="MIT"
depends="py3-packaging"
makedepends="py3-gpep517 py3-installer py3-pdm-backend"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://github.com/frostming/findpython/archive/$pkgver/py3-findpython-$pkgver.tar.gz"
builddir="$srcdir/findpython-$pkgver"

build() {
	export PDM_BUILD_SCM_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
a501b9a2f765da440cfe9dd1db18b4818fb8414ca8cbd098bc68122c7b97a98800f72ef6bec5e2a23d04aa7888f1a6b0a758b40a0f81d24308ae65e181da2cf2  py3-findpython-0.4.1.tar.gz
"
